#-*- coding: utf-8 -*-
import re
pattern = re.compile(r'hello')

result1 = re.match(pattern, 'hello')
result2 = re.match(pattern, 'helloo fans!')
result3 = re.match(pattern, 'helo fans!')
result4 = re.match(pattern, 'hello fans!')

if result1:
	print result1.group()
else:
	print '1 匹配失败'

if result2:
	print result2.group()
else:
	print '2 匹配失败'

if result3:
	print result3.group()
else:
	print '3 匹配失败'

if result4:
	print result4.group()
else:
	print '4 匹配失败'